package com.wt.service;

import com.wt.pojo.User;
import com.wt.service.fallback.UserServiceFialil;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 作者：刘兴
 * 时间:18/12/25
 **/
@FeignClient(value = "MYPROVIDER",path = "user",fallback = UserServiceFialil.class)
public interface UserService {

    @PostMapping
    public String add(User u);

    @DeleteMapping("/{id}")
    public String delete(@PathVariable("id") Integer uid);

    @PutMapping
    public String update(User u);


    @GetMapping
    public String GetUsers(@RequestParam("name") String name, @RequestParam("age") Integer age);

    @GetMapping("list")
    public List<User> list(User u);

}
